package com.yanmaohu.yulia.statement;

import com.yanmaohu.yulia.bean.TransactionCharacteristics;

/**
 * @author Bright Lee
 */
public final class SetTransactionStatement implements SqlTransactionStatement, Statement {

    private int beginIndex;
    private int endIndex;
    private boolean local;
    private TransactionCharacteristics transactionCharacteristics;

    public SetTransactionStatement(int beginIndex, boolean local, TransactionCharacteristics transactionCharacteristics) {
        this.beginIndex = beginIndex;
        this.endIndex = transactionCharacteristics.getEndIndex();
        this.local = local;
        this.transactionCharacteristics = transactionCharacteristics;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public boolean isLocal() {
        return local;
    }

    public TransactionCharacteristics getTransactionCharacteristics() {
        return transactionCharacteristics;
    }

}
